package com.example.droideep.fragment;


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;

import com.example.droideep.R;

public class StaticCompleteInfoFragment extends Fragment {

    private int[] infoResIds = new int[]{
            R.layout.layout_personal_info,
            R.layout.layout_personal_info,
            R.layout.layout_personal_info};

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        final ScrollView parent = (ScrollView) inflater.inflate(R.layout.fragment_complete_infos, container, false);
        final ViewGroup linear = (ViewGroup) parent.findViewById(R.id.first);
        final int count = linear.getChildCount();
        for (int i = 0; i < count; i++) {
            final View child = linear.getChildAt(i);
            if (child instanceof RelativeLayout) {
                child.findViewById(R.id.confirm).setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        StringBuffer sb = new StringBuffer();
                        sb.append("Left:" + child.getLeft() + "\n");
                        sb.append("Right:" + child.getRight() + "\n");
                        sb.append("X:" + child.getX() + "\n");
                        sb.append("Y:" + child.getY() + "\n");
                        sb.append("TranslationX:" + child.getTranslationX() + "\n");
                        sb.append("TranslationY:" + child.getTranslationY());

                    }
                });
            }
        }
        return parent;
    }
}
